package com.inspur.demo.controller;


import com.inspur.demo.client.FeignTestClient01;
import com.inspur.demo.client.FeignTestClient02;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignTestController {

    @Autowired
    private FeignTestClient01 feignTestClient01;

    @Autowired
    private FeignTestClient02 feignTestClient02;

    @GetMapping("/feign/get/{id}")
    public String get(@PathVariable String id) {
        String result = feignTestClient01.get(id);
        return result;
    }

    @GetMapping("/feign/get2/{serviceName}")
    public String get2(@PathVariable String serviceName) {
        String result = feignTestClient02.getServiceInfo(serviceName);
        return result;
    }
}
